import service from './axios'

const env = 'development'

const hosts = {
    development: 'http://120.24.215.144:9501',
    production: 'http://120.24.215.144:9501'
}

// api代理地址 ， 文件config/index.js
const URL = (url) => {
    // return `${process.env.API_HOST}${url}`
    return hosts[env] + url
}


// 登录
export const login = (data) => {
    return service({
        url: URL('/login'),
        method: 'POSt',
        data
    })
}

//获取全部企业信息
export const getAll = () => {
    return service({
        url: URL('/api/all'),
        method: 'GET'
    })
}

// 超标报警
export const overStandardRealTime = () => {
    return service({
        url: URL('/api/overStandardRealTime'),
        method: 'GET',

    })
}
// 超标趋势
export const overweightTrends = () => {
    return service({
        url: URL('/api/overweightTrends'),
        method: 'GET',

    })
}


// 运转率
export const operationRate = () => {
    return service({
        url: URL('/api/operationRate'),
        method: 'GET',

    })
}




// 清洗超期
export const cleaningMaintenance = () => {
    return service({
        url: URL('/api/cleaningMaintenance'),
        method: 'GET'
    })
}
// 各区域日超标统计
export const areaOverStandard = () => {
    return service({
        url: URL('/api/areaOverStandard'),
        method: 'GET'
    })
}

// 检查登陆
export const isLogin = () => {
    return service({
        url: URL('/checkLogin'),
        method: 'POST'
    })
}